from lxml import etree
import requests
import time

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36"
}
a = requests.get(url="https://www.bilibili.com/video/BV1KFaa1Ezzz", headers=headers)
a.encoding="utf-8"
tree = etree.HTML(a.text)
title = tree.xpath("//html/head/title/text()")
print(title)
